<?php
header("Content-type: text/xml"); 
echo "<?xml version='1.0'?>";
echo "<LINKS>";

$uid = $_POST["uid"];

//$uid = 1234;
//$access_token = "abcd";

$con = mysql_connect("localhost", "vatsav", "2T*vzcd");
if (!$con)
{
  die('Could not connect: ' . mysql_error());
}

$db_selected = mysql_select_db("vatsav", $con);
	if (!$db_selected) {
		die ('Cant use db : ' . mysql_error());
}

//$result = mysql_query("SELECT * FROM users where uid=".$_POST['uid']);	
$result = mysql_query("SELECT tag FROM tags where uid=".$uid);	
// Check result
if (!$result) {
   $message  = 'Invalid query: ' . mysql_error() . "<br/>";
   die($message);
}

while($row = mysql_fetch_array($result))
{
	$t2=html_entity_decode($row['tag'],ENT_QUOTES,'UTF-8');
	$t2=addslashes($t2);
	echo "<LS-TAG>".$row['tag']."</LS-TAG>";
	echo "<LS-TAG>".$t2."</LS-TAG>";
}

mysql_close($con);

echo "</LINKS>";
?>
